define(function () {
	return {
		//添加cookie
		addCookie: function (name,value,iDay) {
			var oDate = new Date();
			oDate.setDate(oDate.getDate() + iDay);
			//写入cookie
			document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';expires=' + oDate;
		},
		getCookie: function (name) {
			var aCookie = document.cookie;
			aCookie = aCookie.split('; ');
			for(var i = 0; i < aCookie.length; i++){
				var aTemp = aCookie[i].split('=');
				if(aTemp[0] === name){
					return decodeURIComponent(aTemp[1]);
				}
			}
		}
	}
})